/*
2021-11-9
https://www.acwing.com/problem/content/4073/
*/ 
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;

const int N=15;
int a[N];
int n;

int main()
{
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
    int temp=a[n-1];
    sort(a,a+n);
    cout<<(temp^a[n-1])<<endl;
    return 0;
}

